#!/bin/sh
HOSTNAME=`hostname`
DATADIR=/acfs_mysql/database
mysqlps=$(ps -eaf|grep mysql|grep -v grep |awk '{print $2}')

case "$1" in

'start')
echo "attempting to stop MysqlDb"
/sbin/service mysql start
echo "starting Mysql"
exit 0;
;;

'stop')
echo "attempting to stop MysqlDb"
/sbin/service mysql stop
echo "stopping Mysql"
###exit 0;
;;

'check')
/u01/app/grid/crs/public/check
#/sbin/service mysql status
;;


'STATUS')
echo "attempting to check MysqlDb"
/sbin/service mysql status
exit 0
;;

'clean')
echo "Execute Clean of PID and Lock File"
/bin/rm -f $DATADIR/$HOSTNAME.pid
/bin/rm -f /var/lock/subsys/mysql

for i in $mysqlps
do
/bin/kill -9  $i
done

exit 0

;;

esac
